package lp.xian.materials.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lp.xian.materials.mapper.WarehouseDeptMapper;
import lp.xian.materials.domain.WarehouseDept;
import lp.xian.materials.service.IWarehouseDeptService;

/**
 * 仓库分类Service业务层处理
 *
 * @author ruoyi
 * @date 2023-08-10
 */
@Service
public class WarehouseDeptServiceImpl implements IWarehouseDeptService
{
    @Autowired
    private WarehouseDeptMapper warehouseDeptMapper;

    /**
     * 查询仓库分类
     *
     * @param warehouseDeptId 仓库分类主键
     * @return 仓库分类
     */
    @Override
    public WarehouseDept selectWarehouseDeptByWarehouseDeptId(Integer warehouseDeptId)
    {
        return warehouseDeptMapper.selectWarehouseDeptByWarehouseDeptId(warehouseDeptId);
    }

    /**
     * 查询仓库分类列表
     *
     * @param warehouseDept 仓库分类
     * @return 仓库分类
     */
    @Override
    public List<WarehouseDept> selectWarehouseDeptList(WarehouseDept warehouseDept)
    {
        return warehouseDeptMapper.selectWarehouseDeptList(warehouseDept);
    }

    /**
     * 新增仓库分类
     *
     * @param warehouseDept 仓库分类
     * @return 结果
     */
    @Override
    public int insertWarehouseDept(WarehouseDept warehouseDept)
    {
        warehouseDept.setCreateTime(DateUtils.getNowDate());
        return warehouseDeptMapper.insertWarehouseDept(warehouseDept);
    }

    /**
     * 修改仓库分类
     *
     * @param warehouseDept 仓库分类
     * @return 结果
     */
    @Override
    public int updateWarehouseDept(WarehouseDept warehouseDept)
    {
        warehouseDept.setUpdateTime(DateUtils.getNowDate());
        return warehouseDeptMapper.updateWarehouseDept(warehouseDept);
    }

    /**
     * 批量删除仓库分类
     *
     * @param warehouseDeptIds 需要删除的仓库分类主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseDeptByWarehouseDeptIds(Integer[] warehouseDeptIds)
    {
        return warehouseDeptMapper.deleteWarehouseDeptByWarehouseDeptIds(warehouseDeptIds);
    }

    /**
     * 删除仓库分类信息
     *
     * @param warehouseDeptId 仓库分类主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseDeptByWarehouseDeptId(Integer warehouseDeptId)
    {
        return warehouseDeptMapper.deleteWarehouseDeptByWarehouseDeptId(warehouseDeptId);
    }
}
